<?php

namespace App\Http\Controllers\Test;

use App\Http\Controllers\Controller;
use App\Jobs\DemoJob;


class QueueController extends Controller
{
    // 队列测试
    public function initialize()
    {
        parent::initialize();
    }

    // 发送队列
    public function add()
    {
        $data = ['aa' => 'dddddd', 'bb' => 'dddddddddddddvv'];
        $res  = DemoJob::dispatch($data);

        return $this->success($res);
    }

    // 发送队列
    public function add2()
    {
        $data = ['aa' => 'dddddd', 'bb' => 'dddddddddddddvv'];
        $res  = DemoJob::dispatchIf(true, $data);

        return $this->success($res);
    }
}


